package com.shensi.api.admin.client.fleet;

import com.shensi.api.admin.client.fallback.fleet.FleetInfoClientFallBack;
import com.shensi.api.admin.domian.device.dto.FleetInfoDto;
import com.shensi.api.admin.domian.device.vo.FleetInfoVo;
import com.shensi.common.core.constant.CloudConstant;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = FleetInfoClientFallBack.class)
@Component
public interface FleetInfoClient {

    @GetMapping("/fleet/fleetlist")
    public List<FleetInfoVo> getAllFleets(@SpringQueryMap FleetInfoDto fleetInfo);

    @GetMapping("/fleet/fleetinfo/{id}")
    public FleetInfoVo getFleetInfoById(@PathVariable("id") Integer id);

    @PostMapping("/fleet/createfleet")
    public void createFleet(@RequestBody FleetInfoDto fleetInfo);

    @PutMapping("/fleet/updatefleet/{id}")
    public void updateFleet(@PathVariable("id") Integer id, @RequestBody FleetInfoDto fleetInfo);

    @DeleteMapping("/fleet/deletefleet/{id}")
    public void deleteFleetById(@PathVariable("id") Integer id);

    @DeleteMapping("/fleet/deletefleets")
    public void deleteFleetByIds(@RequestBody List<Integer> ids);
}
